import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { NotificationDetailService } from './detail.service';
import { Notification, Attachment, Notice } from './notification.class';

@Component({
    selector: 'notification-detail',
    templateUrl: 'detail.component.html'
})
export class DetailComponent implements OnInit {

    public notification: Notification;

    constructor(private _router: Router, private _route: ActivatedRoute,
    private _detailService: NotificationDetailService) { }

    ngOnInit() {
        this._route.params.subscribe((params: Params) => {
             this._detailService.getNotification(params['id'])
             .then(notification => this.notification = notification);
        });
     }
}
